package com.hzl.lease.common.context;


//维护LoginUserContext本地线程对象
public class LoginUserContext {
    private  static  final ThreadLocal<LoginUser> threadLocal = new ThreadLocal<>();

    //向threadLocal对象保存token负载信息
    public  static void set(LoginUser loginUser){
        threadLocal.set(loginUser);
    }


    //从threadLocal对象获取token负载信息
    public  static LoginUser get(){
        return    threadLocal.get();
    }


    //删除threadLocal对象保存的token负载信息
    public  static void remove(){
        threadLocal.remove();
    }

}
